package com.css.zfzx.sjcj.modules.hddcB6_GeocheSvyDataTable.repository;

import com.css.zfzx.sjcj.modules.hddcA1InvRgnHasMaterialTable.repository.entity.HddcA1InvrgnhasmaterialtableEntity;
import com.css.zfzx.sjcj.modules.hddcB6_GeocheSvyDataTable.repository.entity.HddcB6GeochesvydatatableEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author zhangcong
 * @date 2020-11-27
 */
public interface HddcB6GeochesvydatatableRepository extends JpaRepository<HddcB6GeochesvydatatableEntity, String> {
    @Modifying
    @Query(nativeQuery = true,value = "update hddc_b6_geochesvydatatable set qualityinspection_status=:s ,extends1=:str where uuid=:uuid")
    void updateStatus(String s, String str, String uuid);
    @Modifying
    @Query(nativeQuery = true,value = "update hddc_b6_geochesvydatatable set qualityinspection_status=:s ,extends2=:str where uuid=:uuid")
    void update2Status(String s, String str, String uuid);

    @Query(nativeQuery = true,value = "select * from hddc_b6_geochesvydatatable where is_valid=1 and extends10=1 ")
    List<HddcB6GeochesvydatatableEntity> findByAll();

    HddcB6GeochesvydatatableEntity findByUuidAndIsValid(String id, String isValid);

    HddcB6GeochesvydatatableEntity findBySvypointidAndIsValid(String svypointid, String isValid);
}
